package com.efeichong.oss;

import lombok.RequiredArgsConstructor;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author lxk
 * @date 2021/11/24
 * @description 自动依赖注入
 */
@RequiredArgsConstructor
@Configuration
@EnableConfigurationProperties({OssConfigLocal.class, OssConfigS3.class})
public class OssAutoConfiguration {
    /**
     * 本地文件操作配置
     */
    private final OssConfigLocal ossConfigLocal;
    /**
     * s3文件操作配置
     */
    private final OssConfigS3 ossConfigS3;

    @Bean
    public OssFactory ossFactory() {
        return new OssFactory(ossConfigLocal, ossConfigS3);
    }


}
